using System;
using System.Data;
using System.Collections.Generic;
using Soccer.Core;
using Soccer.Utility;

namespace Soccer.Business
{
    [TableAttribute("Seasons")]
	[Serializable]
    public class Season : DBO<Season>
    {
		#region Fields
		
		private int? _IdSeason;
		private string _SeasonName;
		private DateTime? _StartDate;
		private DateTime? _EndDate;
		private bool? _IsActived;
		private int? _IdTournament;
		
		#endregion
		
		#region Constructors
		/// <summary>
		/// Default constructor
		/// </summary>
		public Season()
		{
			
		}
		
		/// <summary>
		/// Constructor with IdSeason 
		/// </summary>
		/// <param name="IdSeason">The IdSeason</param>
		public Season(int? IdSeason )
		{
			this.IdSeason = IdSeason;
		}
		
		/// <summary>
		/// Constructor with all parameters
		/// </summary>
		/// <param name="IdSeason">Sets int? value for IdSeason</param>
		/// <param name="SeasonName">Sets string value for SeasonName</param>
		/// <param name="StartDate">Sets DateTime? value for StartDate</param>
		/// <param name="EndDate">Sets DateTime? value for EndDate</param>
		/// <param name="IsActived">Sets bool? value for IsActived</param>
		/// <param name="IdTournament">Sets int? value for IdTournament</param>
		public Season(int? idSeason, string seasonName, DateTime? startDate, DateTime? endDate, bool? isActived, int? idTournament)
		{
			this.IdSeason = idSeason;
			this.SeasonName = seasonName;
			this.StartDate = startDate;
			this.EndDate = endDate;
			this.IsActived = isActived;
			this.IdTournament = idTournament;
		}
		
		#endregion
		
		#region Properties
		
		/// <summary>
		/// Gets or sets int? value for IdSeason
		/// </summary>
		[ColumnAttribute("IdSeason", SqlDbType.Int , 4 , true, true, false)]
		public int? IdSeason
		{
			set
			{
				this._IdSeason = value;
			}
			get
			{
				return this._IdSeason;
			}
		}
		
		/// <summary>
		/// Gets or sets string value for SeasonName
		/// </summary>
		[ColumnAttribute("SeasonName", SqlDbType.NVarChar , 200 , false, false, true)]
		public string SeasonName
		{
			set
			{
				this._SeasonName = value;
			}
			get
			{
				return this._SeasonName;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for StartDate
		/// </summary>
		[ColumnAttribute("StartDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? StartDate
		{
			set
			{
				this._StartDate = value;
			}
			get
			{
				return this._StartDate;
			}
		}
		
		/// <summary>
		/// Gets or sets DateTime? value for EndDate
		/// </summary>
		[ColumnAttribute("EndDate", SqlDbType.DateTime , 8 , false, false, true)]
		public DateTime? EndDate
		{
			set
			{
				this._EndDate = value;
			}
			get
			{
				return this._EndDate;
			}
		}
		
		/// <summary>
		/// Gets or sets bool? value for IsActived
		/// </summary>
		[ColumnAttribute("IsActived", SqlDbType.Bit , 1 , false, false, true)]
		public bool? IsActived
		{
			set
			{
				this._IsActived = value;
			}
			get
			{
				return this._IsActived;
			}
		}
		
		/// <summary>
		/// Gets or sets int? value for IdTournament
		/// </summary>
		[ColumnAttribute("IdTournament", SqlDbType.Int , 4 , false, false, true)]
		public int? IdTournament
		{
			set
			{
				this._IdTournament = value;
			}
			get
			{
				return this._IdTournament;
			}
		}
		
		
		/// <summary>
		/// Get a list ClubSeason of current Season object base on IdSeason
		/// </summary>
		public List<ClubSeason> ClubSeasonListForIdSeason
		{
			get
			{
				if (this.IdSeason == null)
					return null;
				ClubSeason condition = new ClubSeason();
				condition.IdSeason = this.IdSeason;
				return ClubSeasonController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a list Round of current Season object base on IdSeason
		/// </summary>
		public List<Round> RoundListForIdSeason
		{
			get
			{
				if (this.IdSeason == null)
					return null;
				Round condition = new Round();
				condition.IdSeason = this.IdSeason;
				return RoundController.FindItems(condition);
			}
		}
		
		/// <summary>
		/// Get a Tournament of current Season object base on IdTournament
		/// </summary>
		public Tournament Tournament
		{
			get
			{
				if (this.IdTournament == null)
					return null;
	
				Tournament condition = new Tournament(this.IdTournament);
				return TournamentController.FindItem(condition);
			}
		}
		
		#endregion
        
        #region Other Properties
        private static ColumnNameStruct? _ColumnName;
        public static ColumnNameStruct ColumnName
        {
            get
            {
                if (!_ColumnName.HasValue)
                    _ColumnName = new ColumnNameStruct();
                return _ColumnName.Value;
            }
        }
        #endregion

        #region NestedType
        public  struct ColumnNameStruct
        {
            /// <summary>
            /// Get the name of column [IdSeason]
            /// </summary>
            public string IdSeason
            {
                get
                {
                    return "IdSeason";
                }
            }
            /// <summary>
            /// Get the name of column [SeasonName]
            /// </summary>
            public string SeasonName
            {
                get
                {
                    return "SeasonName";
                }
            }
            /// <summary>
            /// Get the name of column [StartDate]
            /// </summary>
            public string StartDate
            {
                get
                {
                    return "StartDate";
                }
            }
            /// <summary>
            /// Get the name of column [EndDate]
            /// </summary>
            public string EndDate
            {
                get
                {
                    return "EndDate";
                }
            }
            /// <summary>
            /// Get the name of column [IsActived]
            /// </summary>
            public string IsActived
            {
                get
                {
                    return "IsActived";
                }
            }
            /// <summary>
            /// Get the name of column [IdTournament]
            /// </summary>
            public string IdTournament
            {
                get
                {
                    return "IdTournament";
                }
            }
        }
        #endregion
    }
}
